package com.example.uchain.utils;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Repository
public class TradeCode {
    public JSONObject addTrade(int CRId,String workName, String workType, String blockAddress, String authorization,String price) {

        List<Serializable> funcParam = new ArrayList<>();

        funcParam.add(CRId);
        funcParam.add(workName);
        funcParam.add(workType);
        funcParam.add(blockAddress);
        funcParam.add(authorization);
        funcParam.add(price);
        return HttpUtils.writeContract("addTrade", funcParam);
    }

//    public String getEvaluate(String evaluateId) {
//        ArrayList<Object> funcParam = new ArrayList<>();
//        funcParam.add(evaluateId);
//        JSONArray result = HttpUtils.readContract("getEvaluate",funcParam);
//        return result.getString(0);
//    }

//    public static void main(String[] args) {
//        MyContract myContract = new MyContract();
//        myContract.addWork(34,"123","123","123","123","123");
//    }
}
